<?php

        $url = "http://apis.juhe.cn/simpleWeather/query";
        $city = $_GET['city'];
        
        $key = "7395d3dc2048cba91aee204208fb3ec8";
        $array = ['city'=>$city,'key'=>$key];


        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

        // POST数据

        curl_setopt($ch, CURLOPT_POST, 1);

        // 把post的变量加上

        curl_setopt($ch, CURLOPT_POSTFIELDS, $array);

        $output = curl_exec($ch);

        curl_close($ch);

        return $output;